package com.quan.system.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.quan.common.biz.support.BaseService;
import com.quan.system.entity.SystemPermission;
import com.quan.system.service.SystemPermissionService;

import tk.mybatis.mapper.entity.Condition;

/**
 * <p>
 * 通用用户权限系统-菜单权限表 服务实现类
 * </p>
 *
 * @author 杨浩泉
 * @since 2018-07-05
 */
@Service
public class SystemPermissionServiceImpl extends BaseService<SystemPermission> implements SystemPermissionService {
	
	@Override
	public List<SystemPermission> findPermissionByMenuId(Long menuId) {
		SystemPermission entity = new SystemPermission() ;
		entity.setMenuId(menuId);
		return super.selectAll(entity);
	}

	@Override
	public void deletePermissionByMenuId(Long id) {
		Condition condition = new Condition(SystemPermission.class) ;
		condition.createCriteria().andEqualTo("menuId", id);
		super.delete(condition);
	}
	
}